package com.itheima02;

public class Work13 {
    public static void main(String[] args) {
        int sum = method(100);
        System.out.println("sum = " + sum);
    }

    public static int method(int n) {
        if (n == 1) {
            return 1;
        }
        return n + method(n - 1);
    }

}
